﻿using System.Text;
using System.IO;
public class A3Product
{
    public string Shape;
    public string Size;
    public string Color;
    public string Clarity;
    public string Cut;
    public string Polish;
    public string Sym;
    public string Flour;
    public string M1;
    public string M2;
    public string M3;
    public string Depth;
    public string Table;
    public string Ref;
    public string CertificateNo;
    public string Detail;
    public string Cert;
    public string RapRate;
    public string Discount;
    public string Price;
    public string ReportNo;

    public string CertificateNoHref;
    public string CertHref;

    public string OutPutStr()
    {
        string output = "";
        output += "Shape:" + this.Shape + " ";
        output += "Size:" + this.Size + " ";
        output += "Color:" + this.Color + " ";
        output += "Clarity:" + this.Clarity + " ";
        output += "Cut:" + this.Cut + " ";
        output += "Polish:" + this.Polish + " ";
        output += "Sym:" + this.Sym + " ";
        output += "M1:" + this.M1 + " ";
        output += "M2:" + this.M2 + " ";
        output += "M3:" + this.M3 + " ";
        output += "Table:" + this.Table + " ";
        output += "Ref:" + this.Ref + " ";
        output += "CertificateNo:" + this.CertificateNo + " ";
        output += "Detail:" + this.Detail + " ";
        output += "Cert:" + this.Cert + " ";
        output += "RapRate:" + this.RapRate + " ";
        output += "Discount:" + this.Discount + " ";
        output += "Price:" + this.Price + " ";
        output += "ReportNo:" + this.ReportNo + " ";
        output += "CertificateNoHref:" + this.CertificateNoHref + " ";
        output += "CertHref:" + this.CertHref + " ";
        return output;
    }

    public static void WriteToFile(string filename, string data)
    {
        ASCIIEncoding encoding = new ASCIIEncoding();
        FileStream fs = new FileStream(filename, FileMode.Create);
        //获得字节数组
        byte[] output_data = encoding.GetBytes(data);
        //开始写入
        fs.Write(output_data, 0, output_data.Length);
        //清空缓冲区、关闭流
        fs.Flush();
        fs.Close();
    }
}